package com.jic.interaction.score.controller;

import com.alibaba.fastjson.JSONObject;
import com.jic.common.base.vo.RestResult;
import com.jic.interaction.score.service.ScoreOrderService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 支付
 */
@RestController
@RequestMapping("/feign/score")
@Api(tags = " [支付接口]")
@Slf4j
//TODO
public class ScoreOrderController {

    @Resource
    private ScoreOrderService scoreOrderService;

    /**
     * 查询用户积分
     * @param ret
     * @return
     */
    @PostMapping("/queryUser")
    public RestResult<JSONObject> queryUser(@RequestBody JSONObject ret){
        return RestResult.success(scoreOrderService.queryUser(ret));
    }
    /**
     * 积分兑换
     * @param ret
     * @return
     */
    @PostMapping("/scorePay")
    public RestResult<JSONObject> scorePay(@RequestBody JSONObject ret){
        return RestResult.success(scoreOrderService.scorePay(ret));
    }
    /**
     * 积分兑换查询
     * @param ret
     * @return
     */
    @PostMapping("/scorePayQuery")
    public RestResult<JSONObject> scorePayQuery(@RequestBody JSONObject ret){
        return RestResult.success(scoreOrderService.scorePayQuery(ret));
    }
}
